package com.home766.dao.impl;

import com.home766.dao.AccountNumberDao;
import com.home766.entity.AccountNumber;
import net.biz.dao.NativeBaseDao;
import net.biz.dao.impl.BaseDaoImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

@Repository("accountNumberDaoImpl")
public class AccountNumberDaoImpl extends BaseDaoImpl<AccountNumber,Long> implements AccountNumberDao{
	@Autowired
	private NativeBaseDao nativeBaseDao;
	@Override
	public AccountNumber getNewest() {
		// TODO Auto-generated method stub
		String sql = " select ac.id as id,max(ac.base_number) as base_Number from 766_account_number ac";
		Map<String,Object> tempMap = new HashMap<String, Object>();
		return nativeBaseDao.findOne(sql, tempMap, AccountNumber.class);
	}

}
